<?php
$id=$_GET['id'];
$ids=$_GET['ids'];
$table=$_GET['table'];
if($id>0 && count($ids)==0){
    $ids[]=$id;
}
foreach($ids as $id){
    if($id>0){
		if($table=='shai'){
			$sql="select tao_id,jifen,dduserid from ".$BIAOTOU."shai where id=".$id;
			$query=mysql_query($sql);
			$row=mysql_fetch_array($query);
			$jifen=$row['jifen'];
			$dduserid=$row['dduserid'];
			$tao_id=$row['tao_id'];
			$sql="update ".$BIAOTOU."user set jifen=jifen-'".$jifen."' where id=".$dduserid;
			mysql_query($sql);
			$sql="INSERT INTO `".$BIAOTOU."shai_blacklist` (`tao_id` ,`time` )VALUES ('".$tao_id."', '".time()."');";
			mysql_query($sql);
		    $sql="delete from ".$BIAOTOU."shai_comment where shai_id='".$id."'";
            mysql_query($sql);
		}
		if($table=='shai_blacklist'){
		    $sql="delete from ".$BIAOTOU.$table." where tao_id='".$id."'";
		}
		else{
		    $sql="delete from ".$BIAOTOU.$table." where id='".$id."'";
		}
        mysql_query($sql);
    }
}

echo alert('删除成功');
?>
